package view.graph
{
	import model.ds.LineSeriesData;
	import model.structure.StructureBase;
	import model.structure.StructureTraffic;
	
	import mx.collections.ArrayCollection;
	import mx.events.FlexEvent;

	public class GraphTraffic extends CustomLineChart
	{
		
		
		
		private var _seriseFieldName:Array = ["totalbps","sipbps","rtpbps"];
		private var _seriseDisPlayName:Array = ["Bps 정보","SIP Bps 정보","RTP Bps 정보"];
		public function GraphTraffic()
		{
			zeroView = true;
			legendWidth = 272;
			super();
		}
		
		override public function get xgap():int
		{
			return 60;
		}

		override public function get seriseFieldName():Array
		{
			return _seriseFieldName;
		}
		override public function get seriseDisPlayName():Array
		{
			return _seriseDisPlayName;
		}
		
		
		override public function setGraphData($data:*):void
		{
			if(graphData)
				graphData.removeAll();
			graphData= new ArrayCollection();
			var c:int = 0;
			
			_data = $data;
			if($data.hasOwnProperty("time"))
				c = _data.time.length;
			
			maxValue = 0;
			for(var i:int = 0;i<c;i++)
			{
				_seriseFieldName[i]	
				//var obj:Object = getGraphObject(i);
				maxValue = setMaxValue(maxValue,_data.totalbps[i],_data.sipbps[i],_data.rtpbps[i])
				
				 var obj:Object = { totalbps	: _data.totalbps[i]
									,	sipbps	: _data.sipbps[i]
									,	rtpbps	: _data.rtpbps[i]
									,	time	: _data.time[i]
				}; 
				graphData.addItem(obj)
			}
			//	trace(graphData);
			drawGraph();
		}
	}
}